package asteroids.model.programs.parsing.expressions;


public abstract class LogicalExpression extends BinaryExpression {

	protected LogicalExpression(E left, E right) {
		super(left, right);
		if(!canHaveAsExpression(right)){
		setExpression(null, null);
		}
		if(!canHaveAsLogicalExpression(left))
			setExpression(null, null);
	}

	
	public boolean canHaveAsLogicalExpression(E expression){
		return (expression.isBoolean() || expression.isString());
	}
	@Override
	public boolean isBoolean(){
		return true;
	}
	public boolean isDouble() {
		return false;
	}
	public boolean isEntity(){
		return false;
	}
	public boolean isString(){
		return false;
	}
}

